package com.yjkf.zh.admin.dao;

import com.yjkf.zh.admin.model.SysUser;
import com.yjkf.zh.admin.model.SysUserDevice;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserMapper {

    List<SysUser> findAll();

    //分页查询
    List<SysUser> findPage();

    //根据用户明分页查询
    List<SysUser> findPageByName(@Param(value="userName") String userName,@Param(value="id") java.lang.Long id); //,
    //List<SysUser> findPageByName(SysUser record);

    List<SysUser> findPageByAdmin(@Param(value="userName") String userName);

    //无参时的分页查询
    List<SysUser> findPageById(@Param(value="id") java.lang.Long id);

    List<SysUser> getUsersForMe(@Param(value="id") Long id);
    //添加用户
    int insertUser(SysUser sysUser);

    //根据Id查询用户信息
    SysUser findById(Long id);

    //根据用户名查询
    SysUser findByName(String username);

    SysUser findByNameWithId(@Param(value = "userName") String userName,@Param(value="id") Long id);

    //更新用户
    int updateByUser(SysUser sysUser);

    //删除用户
    int deleteByUser(Long id);

    //删除用户设备绑定
    int deleteUserDevice(@Param(value="id") Long userId,@Param(value="deviceIdent") String deviceIdent);

    int insertUserDevice(SysUserDevice sysUserDevice);

    //根据用户id查询用户是不是自己创建的
    SysUser findByCreateId(@Param(value="id") Long id);

    List<SysUser> findCreateId(@Param(value="id") Long id);


}
